import request from "@/utils/request";
import defaultSettings from "@/settings";

export const apiUrlConfig = {
  queryUrl: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/list`,
  exportUrl: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/list`,
  delUrl: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/delete`,
}

export function save(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/save`,
    method: 'post',
    data: data
  })
}

export function get(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/get`,
    method: 'get',
    params: {
      id: data
    }
  })
}

export function checkTaskTimedFlowCodeUnique(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/checkTaskTimedFlowCodeUnique`,
    method: 'post',
    data
  })
}

export function checkTaskTimedNameUnique(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/checkTaskTimedNameUnique`,
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/update`,
    method: 'post',
    data: data
  })
}

export function del(ids) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/delete`,
    method: 'post',
    data: {
      ids: ids
    }
  })
}

export function manualExecuteTask(id) {
  return request({
    url: `${defaultSettings.ctx.batchApp}/s/scubeTaskTimedConf/manualExecuteTask`,
    method: 'get',
    params: {
      id: id
    }
  })
}
